package com.cqc.service.impl;

import com.cqc.service.StudentService;
import com.cqc.vo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Service;

import java.util.Locale;

/**
 * @author cui
 * @description TODO
 * @date 2022/7/2
 **/
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    MessageSource messageSource;

    @Override
    public void save(Student student) {
        System.out.println(messageSource.getMessage("login.name", null, null));
        System.out.println(messageSource.getMessage("login.name", null, Locale.CHINA));
        System.out.println(messageSource.getMessage("login.name", null, Locale.US));
//        Assert.isTrue(false, "抛出自定义异常");
    }
}
